<div class="row">

  <div class="col-xs-12">
    <?php
    //显示表单验证错误信息
    echo (validation_errors() != '') ? '<div class="alert alert-danger" role="alert">'.validation_errors('<li>', '</li>').'</div>' : '';

    // 设置form标签属性
    $attributes = array('role' => 'form');
    echo form_open('user/login', $attributes);
  ?>
      <div class="form-group">
        <input type="text" name="username" value="<?php echo set_value('username'); ?>" class="form-control" id="username" placeholder="用户名">
      </div>

      <div class="form-group">
        <input type="password" name="password" value="<?php echo set_value('password'); ?>" class="form-control" id="password" placeholder="密码">
      </div>
      
      <button type="submit" class="btn btn-success">登录</button>
    </form>
  </div>

</div>

  
